package com.lewin.ringroad.net.constants;

/**
 * 雷森报文对象标识枚举
 *
 * @author Jun
 * @since 1.0.0
 */
public enum RaysunCmdEnum {
    timeSetting(0x2),
    pulseData(0x8),
    realtimeSpeed(0x41),
    queueInfo(0x42),
    passingState(0x46),
    averageSpeed(0xa0),
    timeShare(0xa1),
    eventCheck(0xb1),
    coilStatistics(0x51),
    queueStatistics(0x52),
    zoneStatistics(0x53),

    /**
     * 目标数据
     */
    targetFusionData(0x1);

    RaysunCmdEnum(int b) {
        cmd = b;
    }

    public final int cmd;

    public static RaysunCmdEnum valueOf(byte cmd) {
        for (RaysunCmdEnum value : values()) {
            if (value.cmd == (cmd & 0xff)) {
                return value;
            }
        }

        return null;
    }
}
